package com.zc.ui;

import javax.swing.*;

public class LoginJFrame extends JFrame {
//登录
    public LoginJFrame(){
        initextracted();
        JLabel username = new JLabel(new ImageIcon("image\\login\\用户名.png"));
        username.setBounds(116, 140, 47, 17);
        this.getContentPane().add(username);
        JTextField usernameText = new JTextField();
        usernameText.setBounds(195, 134, 200, 30);
        this.getContentPane().add(usernameText);
        JLabel password = new JLabel(new ImageIcon("image\\login\\密码.png"));
        password.setBounds(130, 190, 32, 16);
        this.getContentPane().add(password);
        JPasswordField passwordText = new JPasswordField();
        passwordText.setBounds(195, 181, 200, 30);
        this.getContentPane().add(passwordText);


        JLabel baackground = new JLabel(new ImageIcon("image\\login\\background.png"));
        baackground.setBounds(2, 2, 470, 390);
        this.getContentPane().add(baackground);
        this.getContentPane().repaint();
    }

    private void initextracted() {
        this.setSize(488, 430);
        this.setTitle("登录");  //标题
        this.setAlwaysOnTop(true);  //置顶
        this.setVisible(true);  //显示
        this.setLocationRelativeTo(null);
        this.setLayout(null);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);//关闭窗口
    }
}
